{\rtf1\ansi\ansicpg1252\cocoartf1344\cocoasubrtf720
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural

\f0\fs24 \cf0 How to use CoreTimeDelay:\
\
The main.c file has examples of some of the uses of the core delay timer.  The files needed for the delay timer are CoreTimerDelay.c and CoreTimerDelay.h.  In addition to these 2 files you also need a #define for SYS_CLK_FREQ.  If you use Harmony this is provided by that framework.  If not using Harmony then either use the system_config.h file or add the #define in CoreTimerDelay.h.\
\
CODE config:\
\
1. In the header file set the max number of \'93COREDELAY_MAXCLIENTS\'94.  This is how many clients can be connected to the call back functions at any one time.  If you release the client after it is done with the delay and connect a new client then you can have as many clients as you want.\
2. In the header file set the mac number of \'93COREDELAY_MAXIDS\'94.  This is the max number of delays a client may issue in a row before the next client can use the timer.\
3. In the header file set the interrupt priority \'93COREDELAY_PRIORITY\'94 and sub priority \'93COREDELAY_SUBPRIORITY\'94 of the core timer.  \
\
USE:\
\
1. Always call CoreDelay_Init() before using the Core Delay.\
2. If you only want to use a synchronous delay call \'93CoreDelay_Sync_us()\'94 to wait for the specified time.  Pass in the time in microseconds.  If the timer is busy this will immediately return false.  If the delay occurred then it will return true.\
3. For an asynchronous delay you first need to connect a call back function.  Use \'93CoreDelay_SetDelayCallback\'94 to set up the function to call back when the delay is done. If the max clients has been reached this function will return false.  If true is returned then you may continue with the delay.  There are 4 asynchronous delay functions (CoreDelay_Async_us1(), CoreDelay_Async_us2(), CoreDelay_Async_us3(), and CoreDelay_Async_usA()).  The difference between these functions is in how many delays you want.  If you just want 1 delay use \'93CoreDelay_Async_us1()\'94.  For 2 use \'93CoreDelay_Async_us2()\'94.  For 3 use \'93CoreDelay_Async_us3()\'94.  For more use \'93CoreDelay_Async_usA()\'94.  If 2 or more delays are used then the input has a variable called \'93oneShot\'94.  If set to false each delay will occur one after another an no further action is needed by the client.  The client is informed about each delay as they occur through the call back function.  If the \'93oneShot\'94 is set to true then to start the next delay the client must call \'93CoreDelay_Next()\'94.\
4. In addition to the delay call back there is a busy call back \'93CoreDelay_SetBusyCallback\'94 that clients can use to know if the delay timer is busy.  The client can also call \'93CoreDelay_Busy\'94 to check if the timer is busy.\
5. After the client is done using the timer then they can call \'93CoreDelay_RemoveDelayCallback\'94 and \'93CoreDelay_RemoveBusyCallback\'94 to release the call backs. This allows more than \'93COREDELAY_MAXCLIENTS\'94 to use the timer.  \
6. To stop a timer and make it immediately available to another client call \'93CoreDelay_Abort()\'94.\
\
\
\
}